package com.itgzs.front.mapper;

import com.itgzs.front.bean.Sensor;
import com.itgzs.front.bean.Toggle;
import org.apache.ibatis.annotations.Update;

public interface ToggleMapper {

    @Update(
        "<script>"
            + "UPDATE `toggle` "
                + "<set>"
                    + "<if test='led != null'>led = #{led}, </if>"
                    + "<if test='colorLed != null'>color_led = #{colorLed}, </if>"
                    + "<if test='curtain != null'>curtain = #{curtain}, </if>"
                    + "<if test='degree != null'>degree = #{degree}, </if>"
                    + "</set>"
                + "WHERE id = 1"
        + "</script>"
    )
    void updateToggle(Toggle toggle);
}
